package com.dkd.manage.domain;

import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dkd.common.annotation.Excel;
import com.dkd.common.core.domain.BaseEntity;

/**
 * 工单对象 tb_task
 *
 * @author dkd
 * @date 2025-11-10
 */
public class Task extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 工单ID */
    private Long id;

    /** 工单编号（格式：年月日+序号，如：20251110001） */
    @Excel(name = "工单编号")
    private String taskNo;

    /** 工单类型ID */
    @Excel(name = "工单类型ID")
    private Integer taskTypeId;

    /** 工单类型名称（冗余字段） */
    @Excel(name = "工单类型名称")
    private String taskTypeName;

    /** 设备ID */
    @Excel(name = "设备ID")
    private Long deviceId;

    /** 设备编码（冗余字段） */
    @Excel(name = "设备编码")
    private String deviceCode;

    /** 设备名称（冗余字段） */
    @Excel(name = "设备名称")
    private String deviceName;

    /** 设备状态（冗余）0-离线，1-在线，2-故障，3-维护中 */
    @Excel(name = "设备状态")
    private Integer deviceStatus;

    /** 区域ID（设备所属区域） */
    @Excel(name = "区域ID")
    private Long regionId;

    /** 区域名称 */
    @Excel(name = "区域名称")
    private String regionName;

    /** 执行员工ID */
    @Excel(name = "执行员工ID")
    private Long assigneeId;

    /** 执行员工姓名 */
    @Excel(name = "执行员工姓名")
    private String assigneeName;

    /** 执行员工所属区域ID */
    @Excel(name = "执行员工所属区域ID")
    private Long assigneeRegionId;

    /** 工单描述 */
    @Excel(name = "工单描述")
    private String description;

    /** 优先级：1-高，2-中，3-低 */
    @Excel(name = "优先级", readConverterExp = "1=高,2=中,3=低")
    private Integer priority;

    /** 状态：0-待处理，1-进行中，2-已完成，3-已取消，4-已关闭 */
    @Excel(name = "状态", readConverterExp = "0=待处理,1=进行中,2=已完成,3=已取消,4=已关闭")
    private Integer status;

    /** 状态名称 */
    @Excel(name = "状态名称")
    private String statusName;

    /** 计划开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date scheduledStartTime;

    /** 计划结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date scheduledEndTime;

    /** 实际开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actualStartTime;

    /** 实际结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actualEndTime;

    /** 实际耗时（分钟） */
    @Excel(name = "实际耗时", suffix = "分钟")
    private Integer durationMinutes;

    /** 取消原因 */
    @Excel(name = "取消原因")
    private String cancelReason;

    /** 取消时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "取消时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;

    /** 取消人 */
    @Excel(name = "取消人")
    private String cancelBy;

    /** 完成结果描述 */
    @Excel(name = "完成结果描述")
    private String resultDescription;

    /** 工单详情列表 */
    private List<TaskDetails> taskDetailsList;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setTaskNo(String taskNo)
    {
        this.taskNo = taskNo;
    }

    public String getTaskNo()
    {
        return taskNo;
    }

    public void setTaskTypeId(Integer taskTypeId)
    {
        this.taskTypeId = taskTypeId;
    }

    public Integer getTaskTypeId()
    {
        return taskTypeId;
    }

    public void setTaskTypeName(String taskTypeName)
    {
        this.taskTypeName = taskTypeName;
    }

    public String getTaskTypeName()
    {
        return taskTypeName;
    }

    public void setDeviceId(Long deviceId)
    {
        this.deviceId = deviceId;
    }

    public Long getDeviceId()
    {
        return deviceId;
    }

    public void setDeviceCode(String deviceCode)
    {
        this.deviceCode = deviceCode;
    }

    public String getDeviceCode()
    {
        return deviceCode;
    }

    public void setDeviceName(String deviceName)
    {
        this.deviceName = deviceName;
    }

    public String getDeviceName()
    {
        return deviceName;
    }

    public void setDeviceStatus(Integer deviceStatus)
    {
        this.deviceStatus = deviceStatus;
    }

    public Integer getDeviceStatus()
    {
        return deviceStatus;
    }

    public void setRegionId(Long regionId)
    {
        this.regionId = regionId;
    }

    public Long getRegionId()
    {
        return regionId;
    }

    public void setRegionName(String regionName)
    {
        this.regionName = regionName;
    }

    public String getRegionName()
    {
        return regionName;
    }

    public void setAssigneeId(Long assigneeId)
    {
        this.assigneeId = assigneeId;
    }

    public Long getAssigneeId()
    {
        return assigneeId;
    }

    public void setAssigneeName(String assigneeName)
    {
        this.assigneeName = assigneeName;
    }

    public String getAssigneeName()
    {
        return assigneeName;
    }

    public void setAssigneeRegionId(Long assigneeRegionId)
    {
        this.assigneeRegionId = assigneeRegionId;
    }

    public Long getAssigneeRegionId()
    {
        return assigneeRegionId;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public String getDescription()
    {
        return description;
    }

    public void setPriority(Integer priority)
    {
        this.priority = priority;
    }

    public Integer getPriority()
    {
        return priority;
    }

    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }

    public void setStatusName(String statusName)
    {
        this.statusName = statusName;
    }

    public String getStatusName()
    {
        return statusName;
    }

    public void setScheduledStartTime(Date scheduledStartTime)
    {
        this.scheduledStartTime = scheduledStartTime;
    }

    public Date getScheduledStartTime()
    {
        return scheduledStartTime;
    }

    public void setScheduledEndTime(Date scheduledEndTime)
    {
        this.scheduledEndTime = scheduledEndTime;
    }

    public Date getScheduledEndTime()
    {
        return scheduledEndTime;
    }

    public void setActualStartTime(Date actualStartTime)
    {
        this.actualStartTime = actualStartTime;
    }

    public Date getActualStartTime()
    {
        return actualStartTime;
    }

    public void setActualEndTime(Date actualEndTime)
    {
        this.actualEndTime = actualEndTime;
    }

    public Date getActualEndTime()
    {
        return actualEndTime;
    }

    public void setDurationMinutes(Integer durationMinutes)
    {
        this.durationMinutes = durationMinutes;
    }

    public Integer getDurationMinutes()
    {
        return durationMinutes;
    }

    public void setCancelReason(String cancelReason)
    {
        this.cancelReason = cancelReason;
    }

    public String getCancelReason()
    {
        return cancelReason;
    }

    public void setCancelTime(Date cancelTime)
    {
        this.cancelTime = cancelTime;
    }

    public Date getCancelTime()
    {
        return cancelTime;
    }

    public void setCancelBy(String cancelBy)
    {
        this.cancelBy = cancelBy;
    }

    public String getCancelBy()
    {
        return cancelBy;
    }

    public void setResultDescription(String resultDescription)
    {
        this.resultDescription = resultDescription;
    }

    public String getResultDescription()
    {
        return resultDescription;
    }

    public List<TaskDetails> getTaskDetailsList()
    {
        return taskDetailsList;
    }

    public void setTaskDetailsList(List<TaskDetails> taskDetailsList)
    {
        this.taskDetailsList = taskDetailsList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("taskNo", getTaskNo())
            .append("taskTypeId", getTaskTypeId())
            .append("taskTypeName", getTaskTypeName())
            .append("deviceId", getDeviceId())
            .append("deviceCode", getDeviceCode())
            .append("deviceName", getDeviceName())
            .append("deviceStatus", getDeviceStatus())
            .append("regionId", getRegionId())
            .append("regionName", getRegionName())
            .append("assigneeId", getAssigneeId())
            .append("assigneeName", getAssigneeName())
            .append("assigneeRegionId", getAssigneeRegionId())
            .append("description", getDescription())
            .append("priority", getPriority())
            .append("status", getStatus())
            .append("statusName", getStatusName())
            .append("scheduledStartTime", getScheduledStartTime())
            .append("scheduledEndTime", getScheduledEndTime())
            .append("actualStartTime", getActualStartTime())
            .append("actualEndTime", getActualEndTime())
            .append("durationMinutes", getDurationMinutes())
            .append("cancelReason", getCancelReason())
            .append("cancelTime", getCancelTime())
            .append("cancelBy", getCancelBy())
            .append("resultDescription", getResultDescription())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("taskDetailsList", getTaskDetailsList())
            .toString();
    }
}
